<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/include.inc.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/WEB-INF/views/layout/miiteen/base.ref.jsp" %>
</head>
<body>
<div class="mainpage list">
    <!--顶部菜单-->
    <div class="page-topmenu">
        <shiro:hasPermission name="${tableName}:add">
            <div class="btn-panel">
                <el-button type="primary" size="small" icon="el-icon-plus" @click="add">添加</el-button>
            </div>
        </shiro:hasPermission>
        <shiro:hasPermission name="${tableName}:del">
            <div class="btn-panel">
                <el-button size="small" icon="el-icon-delete" @click="del">删除</el-button>
            </div>
        </shiro:hasPermission>
    </div>
    <!--查询条件-->
    <el-form :inline="true" :model="form" size="small">
        <!--视业务进行更改-begin-->
        <el-form-item label="名称">
            <el-input v-model="form.name" placeholder="名称"></el-input>
        </el-form-item>
        <el-form-item label="编码">
            <el-input v-model="form.codeValue" placeholder="编码"></el-input>
        </el-form-item>
        <!--视业务进行更改-end-->
        <el-form-item>
            <el-button type="primary" @click="search">查询</el-button>
        </el-form-item>
    </el-form>
    <hr/>
    <el-table
            row-key="id"
            :data="grid.data"
            :height="grid.height"
            @selection-change="selectchange">
        <el-table-column
                type="selection"
                width="55">
        </el-table-column>
        <el-table-column prop="name" label="操作" width="100">
            <template slot-scope="scope">
                <a @click="goedit(scope.row.id)" class="grid-operate">编辑</a>
            </template>
        </el-table-column>
        <!--视业务进行更改-begin-->
        <el-table-column prop="name" label="名称"></el-table-column>
        <el-table-column prop="codeValue" label="编码"></el-table-column>
        <el-table-column prop="showOrder" label="顺序"></el-table-column>
        <!--视业务进行更改-end-->
    </el-table>
    <!--分页控件-->
    <%@include file="/WEB-INF/views/layout/miiteen/gridpage.ref.jsp" %>
</div>
<script>
    //初始化数据，必须放置在列表页面封装部分前
    function initVueOption(obj) {
        //设置控制器
        obj.data.controller = "${ctx}/pubTable";
        //设置查询条件默认值
        obj.data.form = {
            tableName: "${tableName}"
        }

        obj.methods.add = function () {
            form.go(this.controller + "/edit?tableName=${tableName}");
        }

        obj.methods.goedit = function (id) {
            form.go(this.controller + "/edit?tableName=${tableName}&id=" + id);
        }

        obj.methods.del = function () {
            form.list.del(this, {tableName: "${tableName}"})
        }
    }
</script>
<!--列表页面封装部分-->
<%@include file="/WEB-INF/views/layout/miiteen/page.list.ref.jsp" %>
</body>
</html>

